<div class="page">

    <div class="row">

        <div class="col-md-8">
            <div class="box box-primary" style="min-height:500px">
                <div class="box-body">
                    <div class="action-bar">
                        <div class="row">
                            <div class="col-sm-8">
                                <form>
                                    <div class="row">
                                        <div class="col-sm-4">
                                            <ui-select ng-model="location.areaCode" theme="bootstrap" onfocus="false"
                                                       on-select="selectAreaCode($select.selected);" required>
                                                <ui-select-match placeholder="选择区域">{{$select.selected.name}}</ui-select-match>
                                                <ui-select-choices
                                                        repeat="areaCode in areaCodes | filter: $select.search">
                                                    <div ng-bind-html="areaCode.name | highlight: $select.search"></div>
                                                </ui-select-choices>
                                            </ui-select>
                                        </div>
                                        <div class="col-sm-5">
                                            <input type="text" class="form-control"
                                                   placeholder="请输入查询条件"
                                                   ng-model="query"/>
                                        </div>
                                        <div class="col-sm-3">
                                            <button class="btn btn-primary" ng-click="searchLocation()">
                                                查询
                                            </button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <div class="col-sm-4">
                                <button class="btn btn-success pull-right" ng-click="addLocation()" btn-auth="location.post">
                                    增加库位
                                </button>
                            </div>
                        </div>
                    </div>
                    <div ng-if="locations.length<=0" class="nodata"></div>
                    <table class="table table-hover" ng-if="locations.length>0">
                        <thead>
                            <tr>
                                <th>序号</th>
                                <th class="text-center">区域</th>
                                <th class="text-center">库位</th>
                                <th class="text-right">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr ng-repeat="location in locations" >
                                <td>{{$index+1}}</td>
                                <td class="text-center">
                                    {{location.areaCode}}
                                </td>
                                <td class="text-center">
                                    {{location.location}}
                                </td>
                                <td  class="text-right">
                                    <button class="btn btn-danger btn-md" ng-click="deleteLocation(location)"
                                            btn-auth="location.delete">删除</button>
                                </td>
                            </tr>
                        </tbody>
                    </table>

                    <div class="text-center">
                        <pagination total-items="pager.totalItems" ng-model="pager.pageNo"
                                    ng-if="pager.totalItems>pager.pageSize"
                                    items-per-page="pager.pageSize" ng-change="getLocation()"
                                    previous-text="上一页" next-text="下一页" max-size="3"></pagination>
                    </div>
                </div>
            </div>

        </div>

        <div class="col-md-4">
            <div class="box box-default">
                <div class="box-body">
                    <div class="action-bar">
                        <div class="row">
                            <div class="col-sm-8">
                                <!-- <form>
                                     <div class="row">
                                         <div class="col-sm-8">
                                             <input type="text" class="form-control"
                                                    placeholder="请输入查询条件"
                                                    ng-model="search"/>
                                         </div>
                                         <div class="col-sm-4">
                                             <button class="btn btn-primary" ng-click="searchArea()">
                                                 查询
                                             </button>
                                         </div>
                                     </div>
                                 </form>-->
                            </div>
                            <div class="col-sm-4">
                                <button class="btn btn-success pull-right" ng-click="addArea()" btn-auth="location.post">
                                    增加区域
                                </button>
                            </div>
                        </div>
                    </div>
                    <div ng-if="areas.length<=0" class="nodata"></div>
                    <table class="table table-hover" ng-if="areas.length>0">
                        <thead>
                        <tr>
                            <th>序号</th>
                            <th class="text-center">区域</th>
                            <th class="text-right">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr ng-repeat="area in areas" >
                            <td>{{$index+1}}</td>
                            <td class="text-center">
                                {{area.name}}
                            </td>
                            <td  class="text-right">
                                <button class="btn btn-danger btn-md" ng-click="deleteArea(area)" btn-auth="location.delete">删除</button>
                            </td>
                        </tr>
                        </tbody>
                    </table>

                    <!-- <div class="text-center">
                         <pagination total-items="pager1.totalItems" ng-model="pager1.pageNo"
                                     ng-if="pager1.totalItems>pager1.pageSize"
                                     items-per-page="pager1.pageSize" ng-change="getAreas()"
                                     previous-text="上一页" next-text="下一页" max-size="3"></pagination>
                     </div>-->
                </div>
            </div>
        </div>

    </div>

</div>

<div class="col-sm-12 col-lg-8 ">

</div>
<div class="page company col-sm-12 col-lg-4 ">

</div>